﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    /*
        var options = SomeOptions.OptionA;
        options = options.SetOn(OptionB);
        options = options.SetOn(OptionC);

        if (options.AnyOf(SomeOptions.OptionA | SomeOptions.OptionB))
        {
        etc.
     */

    public static partial class ByteExtensions
    {
        //TODO:Document http://www.joelonsoftware.com/articles/Unicode.html
        public static byte[] FromString(this byte[] byteArray, string fromString)
        {
            //TODO:Incorportate http://code.google.com/p/ude/
            //UTF8Encoding encoding = new UTF8Encoding();
            //return encoding.GetBytes(fromString);
            //TODO:Check this matches the above size requirements
            {
                if(byteArray.Length==0)
                {
                    byteArray = new byte[fromString.Length];
                }
            }
            Array.Copy(Encoding.Unicode.GetBytes(fromString), byteArray, fromString.Length);
            return byteArray;
        }
    }
}
